package valuecomusa.fijibus.eticket;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import valuecomusa.fijibus.eticket.shorthaul.R;

public class AcctHistoryAdapter extends ArrayAdapter<AcctHistoryInfo>
{
	private Context context;
	
	AcctHistoryAdapter(Context ctx)
	{
		super(ctx, R.layout.history_item);
		context=ctx;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View row=convertView;
		//CampaignHolder holder;
		
	      if (row==null) {                          
	        LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	        row=inflater.inflate(R.layout.history_item, parent, false);
	      }
      
	      AcctHistoryInfo info=getItem(position);
	      
	      TextView htime=(TextView)row.findViewById(R.id.tvTime);
	      htime.setText(info.getTime());
	      
	      TextView hact=(TextView)row.findViewById(R.id.tvDesc);
	      hact.setText(info.getActivities());
	      
	      TextView hamount=(TextView)row.findViewById(R.id.tvAmount);
	      hamount.setText(info.getAmount());
	      
	      TextView hbalance=(TextView)row.findViewById(R.id.tvBalance);
	      hbalance.setText(info.getBalance());
	      
	      return(row);
	}
	
}
